﻿using System;
using System.Text;

namespace ChromiumUpdater
{
    public partial class FrmEditSwitches : IconForm
    {
        public FrmEditSwitches()
        {
            InitializeComponent();
        }

        private StringBuilder _switches= new StringBuilder();

        public StringBuilder Switches
        {
            get { return _switches; }
            set { _switches = value; }
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            if (chkuddprofile.Checked)
            {
                _switches.Append(" --enable-udd-profiles");
            }
            
            if (chksync.Checked)
            {
                _switches.Append(" --enable-sync");
            }

            if (chkProxy.Checked)
            {
                if (txtProxy.TextLength > 0)
                {
                    _switches.Append(" --proxy-server=");
                    _switches.Append(txtProxy.Text);
                }
            }    
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
